/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.ap.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.ap.entity.Sub;
import com.jeeplus.modules.ap.mapper.SubMapper;

/**
 * 支出科目Service
 * @author 李超辉
 * @version 2018-04-23
 */
@Service
@Transactional(readOnly = true)
public class SubService extends TreeService<SubMapper, Sub> {

	public Sub get(String id) {
		return super.get(id);
	}
	
	public List<Sub> findList(Sub sub) {
		if (StringUtils.isNotBlank(sub.getParentIds())){
			sub.setParentIds(","+sub.getParentIds()+",");
		}
		return super.findList(sub);
	}
	
	@Transactional(readOnly = false)
	public void save(Sub sub) {
		super.save(sub);
	}
	
	@Transactional(readOnly = false)
	public void delete(Sub sub) {
		super.delete(sub);
	}
	
}